//
//  WZOutCountOrderView.m
//  ETong
//
//  Created by wanzhao on 15/11/27.
//  Copyright (c) 2015年 wanzhao. All rights reserved.
//

#import "WZOutCountOrderView.h"

@interface WZOutCountOrderView ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) NSArray *orderDataArray;

@end

@implementation WZOutCountOrderView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.dataSource = self;
        self.delegate = self;
        self.orderDataArray = @[@"时间",@"客户"];
    }
    return self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.orderDataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    NSString *str = self.orderDataArray[indexPath.row];
    static NSString *orderCellId = @"orderCellId";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:orderCellId];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:orderCellId];
        cell.textLabel.textAlignment = UITextAlignmentCenter;
        cell.textLabel.font = Font14;
    }
    cell.textLabel.text = str;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *str = self.orderDataArray[indexPath.row];
    if ([self.outOrderdelegate respondsToSelector:@selector(OutCountOrderViewDidSelectCellWithIndexPath:orderText:)]) {
        [self.outOrderdelegate OutCountOrderViewDidSelectCellWithIndexPath:indexPath orderText:str];
    }
}

@end
